package bysj.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public final class GraduateProject implements Comparable<GraduateProject>,Serializable{
	private Integer id;
	private String title;
	//项目的类别，比如：论文，设计
	private GraduateProjectCategory graduateProjectCategory;
	//项目的类型，比如软件开发。理论研究
	private GraduateProjectType graduateProjectType;
	//项目的状态：比如已提交，未提交
	private GraduateProjectStatus graduateProjectStatus;
	//项目的来源，比如
	private GraduateProjectSource graduateProjectSource;
	//项目的真实性，比如
	private GraduateProjectTrueness graduateProjectTrueness;
	//项目包含的学生
	private Student student;
	private int year;
	//学生的分数
	private Double score;
	//项目里的老师，比如指导老师，教研室主任。
	private Teacher teacher;




	public GraduateProject( String title, GraduateProjectCategory graduateProjectCategory, GraduateProjectType graduateProjectType, GraduateProjectStatus graduateProjectStatus, Teacher teacher, Student student, GraduateProjectSource graduateProjectSource, GraduateProjectTrueness graduateProjectTrueness,double score,int year) {
		this.title = title;
		this.graduateProjectCategory = graduateProjectCategory;
		this.graduateProjectType = graduateProjectType;
		this.graduateProjectStatus = graduateProjectStatus;
		this.teacher = teacher;
		this.graduateProjectSource = graduateProjectSource;
		this.graduateProjectTrueness = graduateProjectTrueness;
		this.student = student;
		this.score = score;
		this.year = year;
	}




	@Override
	public int compareTo(GraduateProject o) {
		// TODO Auto-generated method stub
		return this.id - o.id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final GraduateProject other = (GraduateProject) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/**
	 * Constructs a <code>String</code> with all attributes
	 * in name = value format.
	 *
	 * @return a <code>String</code> representation
	 * of this object.
	 */
	public String toString() {
		final String TAB = "    ";

		String retValue = "";

		retValue = "GraduateProject ( "
				+ super.toString() + TAB
				+ "id = " + this.id + TAB
				+ "title = " + this.title + TAB
				+ "projectCategory = " + this.graduateProjectCategory + TAB
				+ "projectType = " + this.graduateProjectType + TAB
				+ "graduateProjectTrueness = " + this.graduateProjectTrueness + TAB
				+ "graduateProjectSource = " + this.graduateProjectSource + TAB
				+ "graduateProjectStatus = " + this.graduateProjectStatus + TAB
				+ "teacher = " + this.teacher + TAB
				//+ "score = " + this.score + TAB
				+ "student = " + this.student + TAB
				+ " )";

		return retValue;
	}
}
